home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 002a / unhang.zip / UNHANG.DOC < prev   
Text File  |  1992-01-01  |  6KB  |  119 lines

  1.        ░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░
  2.        █ UNHANG Version 1.00. (C)Copyright Oleg Kibirev, 1991. ▒
  3.        ░             Documentation file            ▓
  4.        █▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█
  5.  
  6. UNHANG is a tiny (416 byte) TSR that lets you get out of misbehaved programs.
  7. Once it's loaded, Alt/Enter will terminate current process & reset screen to
  8. text mode (the last is important when "breaking" from games). This is similar to
  9. Ctrl/C but helps in infinitely more cases. It will work weather or not a DOS
  10. function is being executed. It will also work with programs that hook interrupt
  11. vectors or change EGA data areas.
  12.  
  13. UNHANG also handles two more cases. One is divide overflow. The default DOS
  14. strategy for this interrupt is displaying message & terminating the program.
  15. However, interrupt vectors are not restored & if program hooks any of them, you
  16. are out of luck. UNHANG handles this situation like Alt+Enter. (Of course, a
  17. more sophisticated program can install it's own handler - UNHANG will not
  18. prevent it from doing this).
  19.  
  20. Another is non-maskable interrupt.  It occurs on memory parity or 80X87 math
  21. error.    Most BIOSes handle this interrupt by locking PC.  This is the worst
  22. strategy possible - you effectively loose ALL memory rather than just one bit -
  23. even not considering a possibility that an error has occurred in parity bit
  24. itself!  UNHANG will terminate a program, notify you about NMI & disable it -
  25. because if the problem is with memory, it's likely to repeat.
  26.  
  27.                   ░░░░░░░░░░░░░░░░░░░░
  28.                   ░░ UNHANG options ░░
  29.                   ░░░░░░░░░░░░░░░░░░░░
  30.  
  31. Each time a program is executed, UNHANG allocates an additional block of memory
  32. to save interrupt vectors 1-3fh. When a program exits, the block is freed.
  33. However, since this block is usually lower in memory than a program itself, a
  34. TSR that loads while UNHANG is active, will leave 208-byte "hole". To solve a
  35. problem, you can put UNHANG to "TSR" mode. In this case interrupts are not
  36. saved. Alt/Enter still functions but it's not a good idea to use it - it will
  37. hang in more situations than in normal mode.
  38.  
  39. All UNHANG options can be abbreviated to one letter - either upper or lowercase:
  40.  
  41. T(SR)     - start TSR mode
  42. N(OTSR)  - resume saving vectors. Use when you are finished with loading TSRs
  43. P(ARITY) - re-enable NMI. Use for diagnostics.
  44.  
  45. T & N options will load UNHANG to memory if it's not already resident.
  46.  
  47.  
  48.                 ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  49.                 ▒▒ Low level comments ▒▒
  50.                 ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  51.  
  52. 1) UNHANG uses locations of PSP that are not used by DOS. When a program
  53. executes a child, the following information is stored in it's (not child's) PSP:
  54.  
  55. PSP:56h - address of the memory block with saved interrupts. The block is 192
  56. bytes long (without MCB) & contains a copy of interrupt vectors 1-3fh
  57. PSP:58h - saved SS of the program calling exec function
  58. PSP:5Ah - saves SP of the program calling exec function
  59.  
  60. 2) TSR/NOTSR modes can be switched from a program:
  61.  
  62. AH = 18H ; Nonexistant DOS function
  63.  
  64. CX = 'OF' to enter TSR mode
  65. CX = 'ON' (or anything else) to resume vector saving
  66.  
  67. Return : DX='OK' if UNHANG is installed
  68.  
  69.  
  70.                    ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  71.                    ▓▓ Limitations ▓▓
  72.                    ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  73.  
  74. 1) UNHANG tries many ways to rescue the system.  When you press Alt/Enter it
  75. clears registers of interrupt controller, calls EGA+ BIOS initialization routine
  76. at C000:0003 to repair EGA data area, resets floppy & hard drives & restores
  77. vectors 1 - 3fh to the values before the start of the program.    I guess not all
  78. of this will work on ALL PCs.  In particular, NOHANG requires EGA or VGA video
  79. board.
  80.  
  81. 2) UNHANG will be unable to operate if the offending program has blocked
  82. keyboard interrupt (so that it just can't get this Alt/Enter). Another "sure"
  83. ways to crash the system are filling low memory with junk or issuing an
  84. instruction like "POP CS" or "MOV AX,[FFFF]".
  85.  
  86. 3) It's easy to make a mess with UNHANG. For example, terminating a program
  87. during a disk operation will cause data to be lost & leave FAT in distorted state
  88. (try CHKDSK /F if this happens). Use Alt/Enter at your own risk.
  89.  
  90. 4) Memory mapping utilities like MEM or MAPMEM will not display the name
  91. "UNHANG" in the list of programs.  Instead, you'll see a 400-byte "data area" of
  92. COMMAND.COM.  The reason is that resident code contains no PSP:  instead of just
  93. using DOS "Stay Resident" function, UNHANG moves it's resident portion 256 bytes
  94. lower in memory, sets current PSP to PSP of a parent program, shrinks program
  95. segment to the size of resident code & makes a far jmp to INT 22H vector.  This
  96. reduces the size of the program in memory by 256 bytes - a good value for tiny
  97. TSRs like UNHANG.  See Ralf Brown's interrupt listing for details about doing
  98. this.
  99.  
  100.                █████████████████████████
  101.                ██ Distributing UNHANG ██
  102.                █████████████████████████
  103.  
  104. This program is freeware. You are encouraged to distribute it either separately
  105. or as a part of your own programs providing that you include both UNHANG.COM &
  106. UNHANG.DOC.
  107.  
  108.  
  109.                 ██████████████
  110. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒█Oleg Kibirev█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  111. ▒                ██████████████                       ▒
  112. ▒ Current address :               ▒  E-MAIL : Try both:               ▒
  113. ▒ 277 Babcock Street P.O. Box 1869     ▒  kibirev@BUCSF.BU.EDU      &           ▒
  114. ▒ Boston MA 02215 USA               ▒  kibirev@CSA.BU.EDU               ▒
  115. ▒ Phone: (617)352-5563               ▒                       ▒
  116. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  117. ▒     Home address : Flat 42 Ilycha street 7, Novosibirsk 630090, USSR      ▒
  118. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  119.